package com.fjnldx.mes.domain.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.thymeleaf.util.StringUtils;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class CopyBc {
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate time;
    private String bc;
    private String gongxu;
    private String org;
    private String cj;
    @JsonIgnore
    private boolean flag;
    @JsonIgnore
    private LocalDateTime startTime;
    @JsonIgnore
    private LocalDateTime endTime;

    public static Boolean checkParams(CopyBc data) {
        return !StringUtils.isEmpty(data.getOrg()) &&!StringUtils.isEmpty(data.getCj()) &&!StringUtils.isEmpty(data.getGongxu()) && !StringUtils.isEmpty(data.getBc()) && data.getTime() != null;
    }
}
